#!/bin/bash

# kubectl proxy --port=8009

ns="
cattle-global-data cattle-ui-plugin-system cert-manager cilium-secrets p-krtkc p-xs8sc"

for s in $ns; do
    # curl -X PUT --data-binary @<(kubectl get namespace $s -o json | sed 's/"kubernetes"//g') -H "Content-Type: application/json" http://127.0.0.1:8009/api/v1/namespaces/$s/finalizedone
    # kubectl get ns $s -o json >$s.json
    # cat $s.json | sed 's/"kubernetes"//g'
    kubectl replace --raw "/api/v1/namespaces/$s/finalize" -f ./$s.json
done
